int num2str(unsigned int num, char *str, int base)
{
	int i = 0;
	unsigned int n;
	char tmp[64];
	while(num>0)
	{
		n = num%base;
		if (n<10)
			tmp[i++] = (char)((int)'0'+n);
		else
			tmp[i++] = (char)((int)'A'+(n-10));
		num /= base;
	}
	i--;
	int j = 0;
	while(i>=0)
		str[j++] = tmp[i--];
	str[j] = '\0';
	return j;
}

int strcmp(char *a, char *b)
{
	int i = 0;

	while(a[i] != '\0' && b[i] != '\0')
	{
		if (a[i] != b[i])
			return i+1;
		i++;
	}
	if(a[i] != b[i])
		return i+1;
	return 0;
}

void strcopy(char *dest, char *src)
{
	unsigned int i = 0;
	while(src[i])
	{
		dest[i] = src[i];
		i++;
	}
	dest[i] = '\0';
}
